package com.eml.service.service.impl;

import com.eml.service.dao.MerchantDao;
import com.eml.service.dao.impl.MerchantDaoImpl;
import com.eml.service.entity.Merchant;
import com.eml.service.service.MerchantService;

public class MerchantServiceImpl implements MerchantService {

    private MerchantDao merchantDao = new MerchantDaoImpl ();
    @Override
    public Merchant merchantLogin(String merchant_accontname, String merchant_password) throws Exception {
            Merchant merchant=merchantDao.selectByMerchantname (merchant_accontname);
            if(merchant == null){
                throw new Exception ("商家不存在");
            }else if(!merchant_password.equals (merchant.getMerchant_password ())){
                throw new Exception ("密码错误");
            }
        return merchant;
    }

    @Override
    public Merchant merchantsRegister(Merchant merchant) throws Exception {
        Merchant merchant1 = merchantDao.merchantsRegister (merchant);
        return merchant1;
    }

    @Override
    public void updateMerchantsPassword() throws Exception {

    }

    @Override
    public void selectMerchantInfo() throws Exception {

    }

    @Override
    public void updateMerchantsBasicInformation() throws Exception {

    }

    @Override
    public void initiateTakeOrdersRequest() throws Exception {

    }

    @Override
    public void writeTakeOrdersInfo() throws Exception {

    }

    @Override
    public void commitTakeOrdersRequest() throws Exception {

    }

    @Override
    public void receivedOrder() throws Exception {

    }

    @Override
    public void checkOrderBasicInfo() throws Exception {

    }

    @Override
    public void prepareProducts() throws Exception {

    }

    @Override
    public void sendDeliveryRequest() throws Exception {

    }

    @Override
    public void commitDeliveryRequest() throws Exception {

    }


}
